﻿/**
* ...
* @author Default
* @version 0.1
*/

package bdz.common.utils{
	import flash.display.BitmapData;
	import flash.display.Bitmap;
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	public class BitmapUtils{
		public static function capture(dobject:DisplayObject, transparent:Boolean = true):Bitmap{
			var tmp:BitmapData = new BitmapData(dobject.width, dobject.height, true, 0x00ffffff);
			tmp.draw(dobject, dobject.transform.matrix);
			return new Bitmap(tmp, "auto", true);
		}
		public static function createBounds(clip:MovieClip,w:Number,h:Number,a:Number, c:Number = 0x000000) {
			clip.graphics.lineStyle(0,c,0);
			clip.graphics.beginFill(c,a);
			clip.graphics.moveTo(0,0);
			clip.graphics.lineTo(0,0);
			clip.graphics.lineTo(w,0);
			clip.graphics.lineTo(w,h);
			clip.graphics.lineTo(0,h);
			clip.graphics.lineTo(0,0);
			clip.graphics.endFill();
		}
	}
	
}